import React, {Component} from 'react'
import ContentLeft from '../../common/ContentLeft'
import ContentRigth from '../../common/ContentRigth'
import {bizs} from "../../../dic"
import  './BusinessDetail.css'

export default class BusinessDetail extends Component {
    constructor(props) {
        super(props)
        this.state = {
            item: bizs.find(x => x.id == this.parseUrl(this.props.location.search).id)
        }
    }

    render() {
        return (
            <div className="ct-at-m">
                <ContentLeft></ContentLeft>
                <ContentRigth>
                    <div className="c-t-texts">
                        <h2>{this.state.item.title}</h2>
                        {
                            this.state.item.texts.map((x,i) => {
                                return (
                                    <div className="wenz-li-txt" key={i}>
                                        <p>{x.context}</p>
                                        <img src={x.img} alt="" style={{'width':'100%','display':x.img?"inline-block":"none"}}/>
                                    </div>
                                );
                            })
                        }
                    </div>
                </ContentRigth>
            </div>
        )
    }
}